package com.bingfor.easycablelink.home.Fragment.lore;

import android.databinding.DataBindingUtil;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.bingfor.easycablelink.R;
import com.bingfor.easycablelink.databinding.IoreInfoItemBinding;
import com.bingfor.easycablelink.widgets.BannerLayout;
import com.bingfor.easycablelink.widgets.MyListView;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by LY on 2017/5/23.
 */

public class IoreItemAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

    private List<String> titles;
    private List<String> Urls = new ArrayList<>();

    public IoreItemAdapter() {

    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {

            return new IoreViewHolder(
                    IoreInfoItemBinding
                            .inflate(LayoutInflater.from(parent.getContext()), parent, false)
                            .getRoot());
        }


    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {

        IoreInfoItemBinding binding = DataBindingUtil.findBinding(holder.itemView);

    }

    @Override
    public int getItemCount() {
        return 4;
    }

    public class IoreViewHolder extends RecyclerView.ViewHolder {
        MyListView recyclerView;
        IoreItemAdapter cableItemAdapter = new IoreItemAdapter();

        public IoreViewHolder(View itemView) {
            super(itemView);
//            recyclerView = (MyListView) itemView.findViewById(R.id.rl_list);
        }
    }

    public class TopViewHolder extends RecyclerView.ViewHolder {
        BannerLayout bannerLayout;

        public TopViewHolder(View itemView) {
            super(itemView);
            bannerLayout = (BannerLayout) itemView.findViewById(R.id.mBannerLayout);
        }
    }

    public void setUrls(List<String> urls) {
        Urls = urls;
        notifyDataSetChanged();
    }

    @Override
    public int getItemViewType(int position) {
        return position;
    }

}
